const {
  rootID,
  appFuncID,
  profileFuncID,
  orgFuncID,
  rnPackageID,
  packageAuditID,
  auditID,
  opLogID,
    userMgntID,
    userSettingID,
    userRoleMgmtID
} = require("../generator");

module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.bulkInsert(
      "t_func",
      [
        {
          id: rnPackageID,
          parent_id: null,
          name: "RN包管理",
          level: "000",
          status: "001",
          icon: "dropbox",
          pattern: "package",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: appFuncID,
          parent_id: null,
          name: "App管理",
          level: "000",
          status: "001",
          icon: "rocket",
          pattern: "app",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: auditID,
          parent_id: null,
          name: "发布审核",
          level: "000",
          status: "001",
          icon: "file-unknown",
          pattern: "auditManagement",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: packageAuditID,
          parent_id: auditID,
          name: "RN包审核",
          level: "001",
          status: "001",
          icon: null,
          pattern: "packageAudit",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: opLogID,
          parent_id: auditID,
          name: "操作记录",
          level: "001",
          status: "001",
          icon: null,
          pattern: "packageLog",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: orgFuncID,
          parent_id: null,
          name: "组织管理",
          level: "000",
          status: "001",
          icon: "team",
          pattern: "org",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: userMgntID,
          parent_id: null,
          name: "用户管理",
          level: "000",
          status: "001",
          icon: "contacts",
          pattern: "userManagement",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: userSettingID,
          parent_id: userMgntID,
          name: "用户设置",
          level: "001",
          status: "001",
          icon: null,
          pattern: "userSetting",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: userRoleMgmtID,
          parent_id: userMgntID,
          name: "角色权限",
          level: "001",
          status: "001",
          icon: null,
          pattern: "role",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: profileFuncID,
          parent_id: null,
          name: "个人设置",
          level: "000",
          status: "001",
          icon: "user",
          pattern: "user",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
      ],
      {}
    );
  },

  down: (queryInterface, Sequelize) => {
    return queryInterface.bulkDelete("t_func", null, {});
  }
};
